package jspservlet.servlet;
import java.io.IOException;
//import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import jspservlet.dao.DeviceDAO;
import jspservlet.dao.impl.DeviceDAOImpl;
import jspservlet.vo.AutoSunVisor;
import jspservlet.vo.Connection;



public class ChangeCoverStateServlet {

    public void doGet(HttpServletRequest req,HttpServletResponse res) 
		throws IOException,ServletException{
	}

	public void doPost(HttpServletRequest req,HttpServletResponse res) 
			throws IOException,ServletException{
        DeviceDAO dao = new DeviceDAOImpl();
        AutoSunVisor autoSunVisor = new AutoSunVisor();
        
        autoSunVisor.setIdDevice(req.getParameter("deviceid"));

        autoSunVisor.setIsOpen(Integer.parseInt(req.getParameter("newpsw"))); //String转int
        try {
            int flag = dao.changeSunIson(autoSunVisor);
        } catch (Exception e) {
            e.printStackTrace();
        } 

    }
}
    

